﻿using AnQinFrameWorkAPI.Service.SystemCore;
using Microsoft.AspNetCore.Mvc;

namespace AnQinFrameWorkAPI.Controllers.SystemCore;

/// <summary>
///     附件上传
/// </summary>
[Route("api/[controller]")]
[ApiController]
[ApiExplorerSettings(GroupName = "SystemCore")]
public class UploadController : ControllerBase
{
    /**
     * 上传业务接口
     */
    private readonly UpLoadService _upLoadService;

    /**
     * 构造函数注入
     */
    public UploadController(UpLoadService upLoadService)
    {
        _upLoadService = upLoadService;
    }

    /// <summary>
    ///     上传附件
    /// </summary>
    [HttpPost]
    public async Task<string> FileUpload(IFormFile file)
    {
        return await _upLoadService.FileUpload(file);
    }
}